package calculatorModel;

public class Div implements IOperation {

	private int[] results;
	
	@Override
	public int[] doIntOperation(int[] element) throws Exception {
		
		
		if(element[1] == 0) {
			throw new Exception("Error: divided by zero");
		} else {
			results = new int[2];
			results[0] = (int)element[0]/element[1];
			results[1] = element[0]%element[1];
			
		}
		return results;
	}

}
